﻿using System.Collections.Generic;
using Headsight.BPMN2WF.BPMN.Model;
using Rhino.Mocks;

namespace Headsight.BPMN2WF.Testing.TestObjCtors
{
    /// <summary>
    /// <see cref="BPMNFlowNodeFactory"/> <see cref="ITestObjCtor{T}"/>.
    /// </summary>
    public class BPMNModelFactoryBPMNFlowNodeCtor : ITestObjCtor<BPMNFlowNodeFactory>
    {
        private IList<BPMNFlowNode> _bpmnFlowNodes;

        public BPMNFlowNodeFactory Create()
        {
            var result = MockRepository.GenerateStub<BPMNFlowNodeFactory>();

            result.Expect(x => x.CreateBPMNFlowNodes(null, null, null)).IgnoreArguments().Return(_bpmnFlowNodes);

            return result;
        }

        public BPMNModelFactoryBPMNFlowNodeCtor With(IList<BPMNFlowNode> bpmnFlowNodes)
        {
            _bpmnFlowNodes = bpmnFlowNodes;

            return this;
        }
    }
}